<?php
/**
*+-------IMBA后台管理广告业务数据的存储操作--------+
*+-------------------------------------------------+
*+---------------基于MongoDB存储的-----------------+
*+-------------------------------------------------+
*+-@author susy.liang <liangling@ilongyuan.com.cn>-+
*+-------------------------------------------------+
*/
namespace Admin\Service;
use \Common\Service\BaseService;

Class AdService extends BaseService
{
	//id, ads_id(对应的广告位),name(广告名称), image(广告图),status(状态),
	//create_time(创建时间),update_time(更新时间),
	// 状态
	//CONST STATUS_PEDDING = 0;	// 审核 pedding
	CONST STATUS_PASS 	 = 1;	// 展示 pass
	CONST STATUS_DEL  	 = -1;  // 删除 delete

	//ERROR 错误
	CONST ERROR_TITLE 	 = '标题不能为空!';

	//自动验证
	protected $_validate = array(
		array('name', 'require', self::ERROR_TITLE, self::MUST_VALIDATE , 'regex', self::MODEL_BOTH)
	);

	//自动完成
	protected $_auto = array(
        array('name', 'htmlspecialchars', self::MODEL_BOTH, 'function'),
        array('image', 'htmlspecialchars', self::MODEL_BOTH, 'function'),
        array('ads_id', 'intval', self::MODEL_BOTH, 'function'),
        array('id', intval, self::MODEL_UPDATE, 'function'),
        array('sort', intval, self::MODEL_UPDATE, 'function'),
        array('create_time', NOW_TIME, self::MODEL_INSERT),
        array('update_time', NOW_TIME, self::MODEL_BOTH),
        array('status', 'intval', self::MODEL_BOTH, 'function'),
    );


}